#pragma once

#include "Upgrades.h"
class MovingObject;

class GrappleGun : public Upgrades
{
public:

	GrappleGun();
	GrappleGun(BaseObject* owner);
	~GrappleGun();

	void Fire();
	void Render();
	void Update(float elapsedTime);
	void HandleEvent(const SGD::Event* pEvent);

	MovingObject* GetGrappleHook()	const						{ return m_pGrappleHook; }
	bool		  SetGrappleHook(MovingObject* grapple);
	void		  KillGrappleHook();

private:
	MovingObject*	m_pGrappleHook = nullptr;
	BaseObject*		m_pOwner = nullptr;
	float			m_fLifeTimer = .5f;
	float			m_fDestroyTimer;
	SGD::Point		oldPosition;
	SGD::Point		newPosition;

	SGD::HAudio		m_aFire;
};